﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class UtilityController
    {
        public int InsertUtility(UtilityInfo info)
        {
            return SQL.InsertUtility(info.UtilityName, info.UtilityType, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void UpdateUtility(UtilityInfo info)
        {
            SQL.UpdateUtility(info.UtilityId, info.UtilityName, info.UtilityType, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void DeleteUtility(UtilityInfo info)
        {
            DeleteUtility(info.UtilityId);
        }
        public void DeleteUtility(int utilityId)
        {
            SQL.DeleteUtility(utilityId);
        }
        public UtilityInfo GetUtility(int utilityId)
        {
            return CBO.FillObject<UtilityInfo>(SQL.GetUtility(utilityId));
        }
        public List<UtilityInfo> ListUtility()
        {
            return CBO.FillCollection<UtilityInfo>(SQL.ListUtility());
        }
        public DataTable SelectUtility()
        {
            return CBO.ConvertToDataTable(ListUtility(), typeof(UtilityInfo));
        }
    }
}
